# 局部变量和全局变量
def fun_01(a):
    b = 5
    print(b)
    c = a + b
    print("a:",a,"b:",b,"c:",c)

# fun_01(3)
# print(b)
# print(a)
# print(c)  # 此处a,b,c是函数fun_01的局部变量，在函数内有效，函数外无效

d = 4
e = 6
def fun_02():
    f = 7
    print(f)
    f += 2
    print(f)
    # d += e
    # print(d)

# fun_02()

g = 4
# print(g)
h = 6
def fun_03():
    f = 7
    print(f)
    f += 2
    print(f)
    global g
    g += h
    print(g)

# fun_03()
# print(g)

def fun_04():
    num1 = 50
    print(num1)
    global num2
    num2 = 30
    print(num2)
    global res
    res = num2 + num1
    print(res)

# fun_04()
# # print(num1)  # 此处num1是函数fun_04的局部变量，不能在函数外使用
# print(num2)
# print(res)
# res = res + num2
# print(res)

def fun_05():
    num3 = 21
    num4 = 26
    res = num3 + num4
    print(res)
    def fun_06():
        nonlocal res
        num7 = res + 28
        print(num7)
        res = res + 1
        print(res)
#     fun_06()
# fun_05()

sum = lambda num8,num9 : num8 + num9
print(sum(8,9))
p = lambda : print("11111")
p()